package com.zhisheng.config;
import com.zhisheng.interceptor.MyLoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Component
public class Myconfig implements WebMvcConfigurer {
    @Autowired
    private MyLoginInterceptor myLoginInterceptor;
    //注册我们的拦截器的
    public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(myLoginInterceptor).addPathPatterns("/**").excludePathPatterns("/login");
    }
}
